package thread;

/**
 * @Author liangzai
 * @Description:
 */
class SingletonHungry{
    private static SingletonHungry instance = new SingletonHungry();

    public static SingletonHungry getInstance(){
        return instance;
    }

    private SingletonHungry(){

    }
}

public class Demo1 {
    public static void main(String[] args) {
        SingletonHungry t1 = SingletonHungry.getInstance();
        SingletonHungry t2 = SingletonHungry.getInstance();
        System.out.println(t1==t2);
    }
}















